// 条码机state

export default {
  namespaced: true,
  
  state: {
    scanString: ''    
  },

  mutations: {
    SET_SCANSTRING: (state, scanString) => {
      state.scanString = scanString    
    }    
  }
}

/**
 * 组建中使用示例代码
 export default {
  computed: {
    scanString() {
      return this.$store.getters.scanString
    }
  },
  watch: {
    scanString(s) {
      if (s) {
        setTimeout(() => {
          // 触发事件 你要做的事
          alert(s)
          // 执行结束后重复为空
          
          this.$store.commit('scanCode/SET_SCANSTRING', '')
        }, 100)
      }
    }
  }
}
 */